//
//  TwoTableViewCell.m
//  UI11home
//
//  Created by apple on 15/11/10.
//  Copyright © 2015年 liyinkai. All rights reserved.
//

#import "TwoTableViewCell.h"

@implementation TwoTableViewCell

-(void)dealloc {
    [_imageview release];
    [super dealloc];
}

//重写初始化方法自定义功能
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubview:self.imageview];
        [_imageview release];
        [self addSubview:self.text1];
        [_text1 release];
    }
    return self;
}

-(void)layoutSubviews {
    //    每次刷新cell都会执行这个方法
    //    老王小贴士：尽量这个方法里面只写布局
    [super layoutSubviews];
    _imageview.frame = CGRectMake(20, 20, 150, 100);
    _text1.frame = CGRectMake(200, 20, 150, 30);
    
}
-(UIImageView *)imageview {
    if (!_imageview) {
        self.imageview  = [[UIImageView alloc] init];
        _imageview.clipsToBounds = YES;
    }
    return _imageview;
}
-(UILabel *)text1 {
    if (!_text1) {
        self.text1 = [[UILabel alloc] init];

    }
    return _text1;
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
